Skip to content

test(compile): fix named-pool 1ES test on Windows CRLF checkout#1487

Merged
jamesadevine merged 1 commit into
mainfrom
test/fix-named-pool-1es-crlf-windows
Jul 13, 2026
Merged

test(compile): fix named-pool 1ES test on Windows CRLF checkout#1487
jamesadevine merged 1 commit into
mainfrom
test/fix-named-pool-1es-crlf-windows

Conversation

@jamesadevine

Copy link
Copy Markdown
Collaborator

Summary

The Daily Build failed only on Windows on 12 & 13 July via the test test_named_pool_demands_compile_to_1es_shared_pool (tests/compiler_tests.rs), panicking with 1ES output should contain extends.parameters.pool mapping.

Root cause (test bug introduced by #1461 feat(compile): support named pool demands):

  • On Windows, git checks out the named-pool-demands-agent.md fixture with CRLF line endings (core.autocrlf=true, no .gitattributes override for fixtures).
  • The test helper compile_named_pool_demands_fixture_for_target injected target: 1es via replacen("description: \"...\"\n", ...) using a bare \n.
  • Against CRLF content the pattern never matched, so target: 1es was silently dropped. The fixture then compiled as the default standalone target — which has no extends.parameters.pool — tripping the assertion.
  • The sibling job/stage cases passed vacuously (standalone still exposes an Agent job with a pool), so only the 1ES case surfaced the bug.

Fix: normalize \r\n\n in the transform closure before the replacen, so the target override applies regardless of checkout line endings. This is purely a test-harness issue; the compiler itself was never broken.

Test plan

  • cargo test --test compiler_tests named_pool → 3 passed (previously failed on Windows)
  • cargo test --test compiler_tests → 184 passed, 0 failed (on Windows)

The named-pool-demands fixture is checked out with CRLF line endings on
Windows (core.autocrlf=true, no .gitattributes override). The test helper
injected `target: 1es` with a `\n`-anchored replacen that never matched
CRLF content, so the override was silently dropped and the fixture
compiled as the default standalone target, failing the
extends.parameters.pool assertion. Normalize CRLF to LF before injecting
the target so the override applies regardless of checkout line endings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: df9064a5-39c8-42a8-b605-4cba91f17dc8
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Rust PR Review

Summary: Looks good — correct, minimal fix for the Windows CRLF test failure.

Findings

✅ What Looks Good

  • The root cause diagnosis is accurate: replacen with a bare \n pattern fails against CRLF content, silently dropping the target: 1es override.
  • The fix is correctly scoped to the test harness closure, not the compiler itself.
  • Normalizing \r\n\n before the replacen is the right approach — it's idempotent on LF-only systems and correctly handles CRLF on Windows.
  • The comment clearly explains why the normalization is needed and when it triggers, which is useful for future readers.
  • No concerns around correctness, security, or project conventions — this is a pure test hygiene fix.

Generated by Rust PR Reviewer for #1487 · 18.8 AIC · ⌖ 5.58 AIC · ⊞ 6.2K ·

@jamesadevine jamesadevine merged commit 1c6f076 into main Jul 13, 2026
18 of 21 checks passed
@jamesadevine jamesadevine deleted the test/fix-named-pool-1es-crlf-windows branch July 13, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant